<template>
  <div class="home">
    <!-- <h2>主页</h2> -->
    <div class="box"></div>
  </div>
</template>

<style lang="less" scoped>
.box {
  width: 100px;
  height: 100px;
  background-color: red;
  transform: translate(0px,0px) rotate(45deg);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  &::after {
    content: "";
    display: block;
    width: 40px;
    height: 40px;
    background-color: #fff;
    transform: rotate(-45deg);
  }
}
</style>


<script>
// 导入API方法
import { ranksIndexTop } from '../api/index'

export default {
  name: 'HomeView',
  components: {
    
  },
  created(){
    // 测试
    //  console.log(typeof axios)// 'function' 

    // 接口地址：
    // URL: http://localhost:8080/api/v2/ranks/index-top3
    // 请求方式: GET

    // 直接调用axios请求接口数据
    //  let promise = axios.get("http://localhost:8080/api/v2/ranks/index-top3")
    //  promise.then(
    //   content=>{
    //     console.log("数据:",content)
    //   }
    //  )

    // 调用封装过的方法
    ranksIndexTop()
    .then(
      content=>{
        console.log("数据:",content)
      },
      err=>{
        console.log(err)
      }
     )

  }
}
</script>
